miscellaneous bug fixes
miscellaneous bug fixes