Remove unused atoms
Fix memory access