The ticking sound tells me you have an exhaust leak which could be part of the reason you have a code. I would reccomend purchasing a premade extension so you KNOW that isn't the problem.

If anything got on the sensor whilei it was out, it could be bad.