Change comparison operators to be type safe