Fix Python 3 compatibility
Slightly cleaner filters.build function