Various small improvements and fixes.