Fixes for clang -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error

Fixes 'Illegal instruction' when SWIG executes and compiled with above
compiler options

Fixes #263