Fixed for register and login.

It basically works now. Still need to check passwords.