Fixed grid resizing bug

Resizing the grid made the border blocks be put in the wrong spot
because of a type conversion bug