Changed the constraint to the new one
Changed the flash message handling to use the non-deprecated api

This fixes the compatibility with symfony 2.3