Fixed login issues and tests passing