Fix potential bug about Hash.

Some cosmetic fixes to prevent potential error of Hash.