Fixed error in reading of grid file