Fix fuzz testing bugs