Corrected a bug which caused hash values to be negative