Various Bug fixes and enhancements.