Added check for buffer override in insert. Fold test corrected.