Fixed a bug in the comparison method