Fixed a problem with the new index implementation and pthread timewait