Minor adjustments and bugfixing