Fixed data loading

Data load failed if dataset contains extra \n at the end.