Make local filtering resilient to litter in filter spec

Reviewer: raymond