segfault with test3, + new test cases