Fixed a few more things for matlab