Assure that transform is not changing cached object

Fix for #2026.