A few enhancements and bugfixes