bug fixes and enhancements