Improved the command line parsing code