Fix well index calculation