before(), after() and replaceWith() only converted string arguments to Text nodes; other primitives (numbers, booleans, null) were passed straight to insert_before with no _nid, corrupting the call. Route them through the shared _convertNodes helper (the same path append/prepend use), so every non-node argument becomes document.createTextNode(String(n)). Fixes #498