bug fix to test_main.cpp