- added more error checking in case segfault reproduced from: https://forum.megaglest.org/index.php?topic=9612.0;topicseen