assortment of bugfixes