Fixed atomic reference. Removed unneeded debug line.