Updated filter to hopefully fix segfaults due to Python and threads.