Fix the way flash messages are set