Some C++ tweaking