Change comparison operator to type safe