bug fixes and other enhancements