add portability fixes from #1720

No match.