various miscellaneous fixes