fix arithmetic overflow for hashCode, fixes #4