A set of modifications for Matlab support