Fixing segfault caused by recent commit