Fix missing error message in read_mat