fixed a few bugs relating to the command line functions