Miscellaneous fixes and enhancements.