More work on fixing up metatheory