Fixed a segmentation fault waiting to happen.