numerous bug fixes/enhancements