Fix user login and flash messages