MODE-1799 - Fixed the moving of nodes located under root.

Should be merged into 3.1.x and cherry-picked into master.