fixes correct parent target for right insertion in tree

fixes #3021