This patch adds a necessary reinitialization of passability grid and dirtiness grid for the pathfinder. This fixes an assertion failure in Atlas when resizing the map and starting the simulation, as well as an unreported segmentation fault that would happen a few lines after the assertion failure.
It also adds a check to a helper function in Grid.