Fix get child index function.

Now makes sure that both the remove target node and child it is being
checked against are strings or both are no string. For strings it just
compares them with == operator and for objects it compares their hashes.