Fix form filtering

fixes http://manage.dimagi.com/default.asp?146640