miscellaneous bug fix