Fixed Array Index Out of Bounds Exception when parsing options