Fixing segmentation fault introduced by previous commit