Fixed all the filters. Code is a bit ugly.