Fixed segmentation fault.