Try to fix segfault in snp function