Bug fixes, and enhancements