Fix fill region mode bug. Select only the first matching prefix.