Fixed bugs in data loader