login and other fixes