Guard against nils in map generation; try to avoid nils in the future