Corrects document.importNode, fixes #317