Fixed a bug when loading indices from MAT files