mainly bug fixes