Fix hash bug - caused failure after 35k stages, sigh
Address review comments - rename toHash to nonNegativeHash
Merge pull request #890 from mridulm/master

Fix hash bug