Clean up flash messages. Fixes #554.