Various tweaks and fixes.