fixed bugs in MATLAB interface functions