Fix build on C++ targets and remove unncessary dither variables