Fixed filter and added more assertions to the test cases."