Fixed a bug in Equals()