Fixed OSX build for MATLAB