Cleanup.

        The old util functions moved to th-alpha.
        Fix non-exhaustivity warnings.