Fixed OSX compilation bug