Fixed mysterious segfault