Fixed the thing crashing on a vector of length 0.