Added a rather ugly workaround for a SWIG 3 bug
Merge branch 'tickets/DM-768'