Fix linting issues
Better command line argument handling and error reporting