Fix #559 - Fix segfault (workarounds)