Fixed embarrasing segfault