Fixed crashes. Still doesn't render the map correctly.