This solved issue #140 for me.

Well for now we should merge this as it fixes crashes. Let's try to come up with a better way to prevent this later.