Various changes and fixes.