Defects in silicon carbide: effect on electrical and optical properties