Minor changes to validator.js