Fix bugs in account creation