Fixing possible segfault.