Fixed 'segmentation fault' errors.