Fixed filter patches causing validity checks to fail.

Also improved the information provided by the error messages when
failure occurs.