Fixes to user registration