C++ compiler poratability fixes