Add cleanup()'s before process termination

`valgrind` showed some 'still reachable' memory blocks. It turned out that cleanup_options was never used.
Now `valgrind` outputs that 'no leaks are possible'. Hooray!