Fix bug in IO manager when number of capabilities is changed; fixes #8087

Patch from parcs.