Fix id sequence for instances.