Log and fix for mysterious segfaults