Fix segmentation fault.