Fixed createGrid, wrong index build.