Various fixes and enhancements.