Fixed bug in isEqual