Compilation and build fixes