Fix segfaults in filters.