Fix linux build.

Integrate linux build fixes from eiriksm