matlab mex tweaks