fix darwin build errors