Numerous minor bug fixes and enhancements.