Updated registration and login, fixed some bugs