swig wrappers: add sanitychecks