fixing enclosure handling when length is missing.