A bunch of fixes.