Fix a bug in CollectNonFunctorAtoms.