Fixed bug in ChangeNodeType(); Added test