Fix tests and getorcreateuser