Command line improvements

More robust command line handling