Fix multiple compilation errors for all platforms.

Buildbot's been stalled all day, so this should fix it.