Better enclosure length parsing