Fixed filtering bugs.