Some tidyup of the C++ snippets