cleanup, commandline option, bugfixes