resolved a number of bugs