Having a 'MAT_SIZE_T' that is sometimes an int and sometimes an mwSignedIndex is asking for trouble. The practical impact for OPM is low, though, as this issue affects only the MEX interface.