Throw error when getting parent index of root node
Add more tests