Some fixes after rebase