Bugfix: negative n_photons cause problem in spectra calculations.