Minor changes and bugfixes