Matlab-related model changes and cleanup of