Fix to mkuser, create file object after all other checks to avoid creating user object half-formed on error