diff --git a/js-assembler/runtime-src/baselib-ports.js b/js-assembler/runtime-src/baselib-ports.js
index cbf98f4..f590cb2 100644
--- a/js-assembler/runtime-src/baselib-ports.js
+++ b/js-assembler/runtime-src/baselib-ports.js
@@ -16,7 +16,7 @@
StandardOutputPort.prototype = baselib.heir(OutputPort.prototype);
StandardOutputPort.prototype.writeDomNode = function(MACHINE, domNode) {
MACHINE.params['currentDisplayer'](MACHINE, domNode);
- jQuery(domNode).trigger({type : 'afterAttach'});
+ jQuery('*', domNode).trigger({type : 'afterAttach'});
};
var StandardErrorPort = function() {
@@ -25,7 +25,7 @@
StandardErrorPort.prototype = baselib.heir(OutputPort.prototype);
StandardErrorPort.prototype.writeDomNode = function(MACHINE, domNode) {
MACHINE.params['currentErrorDisplayer'](MACHINE, domNode);
- jQuery(domNode).trigger({type : 'afterAttach'});
+ jQuery('*', domNode).trigger({type : 'afterAttach'});
};
diff --git a/world/kernel.js b/world/kernel.js
index a9421ed..18683af 100644
--- a/world/kernel.js
+++ b/world/kernel.js
@@ -27,8 +27,9 @@ var bigBang = function(MACHINE, initW, handlers) {
var oldArgcount = MACHINE.argcount;
- var toplevelNode = $('').get(0);
- MACHINE.params.currentOutputPort.writeDomNode(MACHINE, toplevelNode);
+ var outerToplevelNode = $('').get(0);
+ MACHINE.params.currentOutputPort.writeDomNode(MACHINE, outerToplevelNode);
+ var toplevelNode = $('').appendTo(outerToplevelNode).get(0);
var configs = [];
var isOutputConfigSeen = false;