Use argparse instead of getopt.
Minor changes