Make mongoose compatible with mangled variable names and clear validation errors when validate() is called #2302