Added hashCode method.
Fixed default constructor.