fixed recursion error when applying filter on flattened object (closes #316)