Fixed login and some errors