Gcc build fixes