• make sure `maxsurrogates' exceeds number of input variables
  • fix problems reported by valgrind