Fix Login and authentication issues