This reverts commit 67babc6702ce74e7565141447f774f39e0fa5757. Unfortunately the segfault still seem to happen.