fix various issues concerning parents and drag-drop