Update ensure_index.

The ensure_index method is checking for all indexes - which does not necessary work
in all cases.
Merge pull request #14 from xethorn/xethorn-14-oct-add-more-tests

Update ensure_index.