Add unittest for SimpleFilter, fix some other things