ML: Fixed small indexing errors in matlab