fix: swap was off by one when checking if an index was too large