fix bugs with form filter
Merge branch 's-hist' into staging2