Fix a few lazy bugs
Routine to remove duplicate atoms