minor bug fixes andfew enhancements