Minor modifications for grids.
Changes for obstacle detection.