Fix some bugs in assessSwap