Fixing match expression for tdg