Fix problems in CMake build scripts
Make NicePyConsole example work with python3