Improved the hashCode() function.