fix all randomly generated segfaults (but one)