Node-swapping stuff.

@wronk