cmd-line done, some minor fixes needed