Bugfixes and minor feature enhancements