Update scripts

Various build fixes.