* free foreign memory as necessary when running into errors

* cross-validation

* predict-values
