Fix index out of range issue when parsing global flags

https://github.com/github/hub/issues/698