Changes to restore matlab compatibility.