fixes to matlab files