Fixed a crash in level generator destroy functions.