Various build fixes