Changed C++ dialect, now compatible with most GNU compliant systems. Fixed memory leaks.