Fixed some bugs with registration/login