Fix issues and documentation in Ensure.

Speed up by doing O(1), not O(n).