Unwrap if needed for the reference node of insertBefore
Merge pull request #324 from arv/unwrap-if-needed

Unwrap if needed for the reference node in insertBefore