Corrected compilation errors in main.cpp