Fixed a subtle bug when no user logged in with gui set.