Found a bug in test code, and fixed it. Added debug output in filtering