Bug fix: swap with temporary is not allowed