Bug fix for before and after filters.