Bunch of fixes.