Fix infinite wavelength bug.