fix some more index bugs