Fixed Choose_wavelength and x, added more tests