fix some bugs from before initial commit