Fixed errors that occur in train and fetch when there is no data in datastore