Cleaned up code using CppCheck
Selected original directory when setting a new one

And fixed a memory leak
Don't put XML header in generated DTDs
Removed duplicated libraries
Fixed error indicators for wxWidgets 2.9+