Fix equals/hashCode: Prevent NullPointer Exception in hashCode and use correct comparisson in equals.