Fix issue with precisions of floats when creating grids