Fix issues and documentation in Ensure.

Speedup by doing O(1), not O(n).