Some fixes after rebasing.