Fix a segmentation fault