Added equals and hashCode methods to some classes.