Nodes: type was incorrectly saved

Closes #366
Nodes: move initialization code to end of method