Compilation fixes
Following upstream