sid: More cleanup, C++ conversion.