fix counting occurences of predicates