Fix a bug in photon emission from deexciting an atom