bugfixes and enhancements