Fix preprocessor logic for CG/QT