Fix core crash (http://blizzlike.dx.am/index.php?topic=88.0)