More ms vc fixes

This is a rework of Lukas Korous's patch for derivative_approximation.{h,cc,inst.in}.