issue #4693: fix compiling error and fix more warnings