Fixed all bugs in login and registration