Fixed bug that freed non-existing map objects, triggered segfaults.