Fixed bug in isEqualTo method