Fix bug in comparison