Fix some issues in parent handling.