Improved swig wrappers