Correctly handle command line arguments