Nonlinear transformations and the numerical treatment of shocks