Fix magic bits if the hash code is negative