Fix some bugs in User.scala.