miscellaneous cleanup and fixes