Fixed some bugs in __eq__ operator implementation.