Improve tests and flash message