some fixes required after rebase to 3.13.0