Worked around gather_atoms crashing when no atoms present.