After liftoff, and initial climb out, everything was still performing as expected. We entered the clouds about the time of gear retraction. As soon as the gear was up, the number one engine started surging and the number two engine started backfiring. I briefed that we would continue straight ahead to the ADF and return for landing. I looked down at the ADF indicator and it was rotating continuously.