Debug segfault due to first getvar()