Fix bugs with login dialog