Fix invalid comparison issue