Edit main to ensure stack fully unwound on exception.
Tidy CMakeLists.txt.