Fixed compare bugs