Fixed bug (reduce of empty array) when the vector is empty.