Fixed typo causing ArrayIndexOutOfBounds exceptions.