Fixes grid initialization.