Make indexes work. Make compatible with Pymongo >= 2.0.1.