Fix a potential segfault.