bug fixes, performance enhancements