Fix more build issues in macos mavericks