Fixed Segfault on game exit