Fixed Logins

I fixed most of the bugs in the login system. Adding users makes things
crash though.