Fixed registration and login functionality