Fixes the segmentation fault.