In and Cd as defect traps in titanium dioxide