hesation at WOT

I just recently changed the oil pan gasket, timing cover gasket and water pump gasket along with the water pump. When I put the engine back together I get hesation at WOT and when engine hits about 3500 it takes off along with a backfire through the exhaust when I let off the pedal. I pulled the codes and I get 31 EGR (KOEO) and 23 (KOER). I replaced the TPS and set it to .75 but with no luck. I did have a couple exhaust header bolts loose which I tighten and that did not seem to help. I recently noticed a ticking sound on the pass. side but I took a screwdriver and put it on the valve cover and it sounds like it is not coming from the valves. Maybe at the flange from the headers to the pipe, would this cause a back fire?
 
I checked the initial timing and it was at 12 and when the spout was in it went to 32. When I adjusted the dizzy to make the ticking go away it was at 20 initial which sounds like a lot. I am running 91 octane if that make a difference.