various minor bugfixes