Fixed bug in User.validate()