Fix compile of current master branch without PR2244 merged.