Fix for cfg logic