Fixed a couple of bugs in User model.