Fixed the bugs in NavMesh and NavMeshDetail that caused crashes at runtime