Convert to raw ptr to support C++03.
Fix compiler errors.