improved swig compatibility