Hopefully fixed logic for command line parsing