Fixed level generation segfault