Fixed bug in argument parsing

The bug was caused by forgetting that sys.argv[0] is the name of the program.