Fix compilation issue and tweaked run_test.sh