Necessary fixes for incompatible changes in Matlab v8.2