Make argument parsing more robust