Fix getRow range calculation and return type.