Fixed cpp issues