Corrected segfault