Cleanup and support for cmdline