Fix build errors, and test for filter