Fix bug with equals and hashCode.