Fixed encryption issue for auto-swap