Fix login bad behavior.