Fix exception when inserting namespace node

Regression from 8452756d29ab0f4724aa1c90b90dfc215a0a9a50