Fixes a few bugs when parsing required arguments.