some minor bug fixes