Fix nullpointers on maze boundaries.