Added headprefix/headsuffix length check