Fixed bugs in comparision