Fixed fetch range batches
Fixed setting end when range is empty