bug fix in the way loadMatrix is handled in ret code