Add a test case that the user already exists

and some fix. Close #6.