Fixes potential crasher

Ensure there is enough information to extract from the raw header when
copying a literal string.
Clean up