Fixed issues with filtering not being applied correctly