Done. Still this randomly segfaults on some platforms. Any idea why?