Miscellaneous tweaks and fixes.