Fixed bug with generating read ranges