Fix various CPP97 compilation issues