Fixed strange linux segfault bug