compilation fixes for the mac