couple of enhancements and bug fixes