Normally if your maf is faulty, if you disconnect it the the car should idle better.
As for code clearing, temporarily disconnecting the battery should work but be prepared to see a few check lights in the dashboard once you restart. These lights should disappear after driving a short distance so be warned.