Bug fixes to user controller