fixed some minor bugs in filter