fixed mex file for new MAP inference interface