Added proper model validation for registration.