Fixed compilation errors + cmake errors.