fixes for sorting nodes
Revert "updated usages of Function to CustomNodeInstance"

This reverts commit 5fc82eae913e7692aab47e931e2be5d09d311ee2.