mostly bug fixes