Compute current hCount correctly instead of incrementing a counter.