Do a swap correctly.
num_caps -> ncaps