Attempted fix to Segmentation Fault on Linux