Fixed logging to diagnose crash cause.