Fixed bugs in comparison.py