Fix sum type equality check