small bug fixes and enhancements