Fixed bug when computing individual grid sizes