Add finite-difference support.
wrap.cc: remove some warnings.