Various build fixes from Arnaud