fix a lot of crashes when submitting an invalid user form. fixes #403, fixes #351
Merge pull request #425 from karyon/fix_user_form

fix the user form.