Fixing the swap problem