We were using the wrong data descriptor to compute the offset (using dist data index instead of data idx)