Fix tests using swap operators