Rewrote proof kernel to fix bugs with names.