Fix erroneous overflow error seen with vectors of length 0.