Fix some plain old Javascript gotchas

Don't use the toString method which may not exist
Re-initialize the value for validatorErr every loop iteration
Merge pull request #65 from Acubed/master

Fix some plain old Javascript gotchas