Registration fix.

Correct error message output when login or email duplicated or database
error occured.