fix find_all_primitives