Fixed issue #874 by ensuring that h_index is never negative 

...(which only appears to happen when distance is exactly 0).