Bug fixes:
- Avoid \..\ in application path and 2 buffer overflows
- At the end of the program, terminate the process by a calling
TerminateProcess instead of returning from main. This avoids
crashes in the cleanup code of the C-runtime library.