fix some additional bugs