Fixes heap corruption in Map::findPath

Fixes issue #469