cleanup, corrections in main.cpp