Fixed FPS issues, improved C++ compatability.