Hello Good People!

I have bought a Scion tC 2009 automatic with 115,000 miles on it. I have driven it for about 1500 miles now, and the gas mileage is terrible.
I keep getting the P0101 code often, sometimes it goes away and then comes back after driving for 50-100 miles.

Things that I did:
- I know it's a MAF sensor code. I used the MAF sensor cleaner and then reset the ECU by disconnecting the battery for 15 mins.
- Changed the air filter.
- That didn't help, so I bought a new Denso MAF sensor and replaced the old one and reset the ECU again. The CEL is still on, and the codes are P0101 and P0606.
- The P0606, I believe, is a generic code for the PCM, which is there because of the P0101.

The gas mileage I am getting is around 200 miles with a full tank (about 13 gallons), so about 15 MPG and this is mostly city driving, I rarely drive on highways.

Other symptoms that I noticed:
- The idle RPM is not completely stable. It idles at a range of 600-750 RPM, and at low RPMs of 600, the car vibrates.

The acceleration is fine and according to me it drives alright.

What could be the problem?? Does anyone have any similar prior experience? Is it a vacuum leak issue?

Any help would be appreciated. Thank you!