Avoid mutation of node when setting explicit type