Fix another by reference/value issue that causes segmentation faults