added code for patching broken binders by refining sorts during wf-index-build