More fixes to main.cpp