Fixed bug where the bytes to read from file were not calculated
correctly.