Fix a segmentation error