a couple of fixes after rebase