Fix a bug in the new filtering stuff