mac specific compilation fixes