multiple minor bug fixes