Fix for compilation problem and a segmentation faults on Darwin/Mac OSX X