miscellaneous fixes and improvements