Ensure jsdoc attached to correct elem when inside of deferred node

Fix for issue #227