OK, put that code back to what it used to be, I think I have the correct fix.
find the following line:
if (formElement.length && inputType.toLowerCase()!="radio" && inputType.toLowerCase()!="select") formElement=formElement[0];
and change it to:
if (formElement.length && inputType.toLowerCase()!="radio" && inputType.toLowerCase()!="select") formElement=formElement[0];
I am logging this as a bug to corrected in a future version.