Fixed bug in nonlinearity correction.