Fixes for building against MATLAB R2012b