Multiple bug fixes and enhancements.