fix #10399: correctly calculate row and column for wells