(PUP-3604) Rework handling of :ensure with a version

Good point, I've added such a test now and fixed the tyop.