Second order corrections for non-differentiable optimization