Fixed bug in filtering posts. Added more tests.