Fixed the hashcode and equals methods