miscellaneous bugfixes