Make custom filters safer