Z5: matlab fixes