Fix for overlapping boxes

It seems there was a typo when initializing the grid array. This caused some grid cells to not be set as "used" and therefore, caused overlapping later on.