fix loadmat, add data loading tests