Better filtering. Fixes #132