misc enhancements and bugfixes