Fix compilation errors from compiler upgrade