Fixed code gen for atomic