Fixed OutOfBounds error within grammarParser