Fix namespace and threshold indexing.