Fixed segfault at border of map.