Cleanups, tests, and no-cover directives for code sections we can't test.