Fixed strange segfault