Revert the previous change as it's just wrong. A node def means 'insert whatever comes back from the adapter into the doc', so post processing that isn't right. It also doesn't solve the problem at hand. So remove it but leave in the corrected checking.