Nonlinearity compensation