Tighten addTypeValidation and the validations.

typeof null is 'object', but null isn't intended to object. So it must be
failed.