Fix trailing newlines in filters.