Bug fix in creating arraybased headgrammarslots