Fixing a this-bug when running type validations. Javascript is great.