Fix compilation errors
Merge pull request #4592 from wmtan/FixCompilationErrors

Fix compilation errors (URGENT)