Bugfix in swap check