Moved around some of the sanity checks
Nodes edit in place, regexp replace