Pick up internal global variables, fix segfaults