In your update() and mouseover() functions, you are passing (d) which is the actual node data, and then using hard-coded index [0] to calculate the fill value. Index 0 is always the first element in the array, so all the countries are getting the same color (and tooltips) as the first country.
Instead, your functions should pass (d, i) as in line #105, and the array index should be [i]. D3 functions get the index number as the second argument -- once you start using that it should work for you.