Fixed tests but introduce segfaults (behavior same as trunk)