What MAF sensor did you install? Does the transfer function match the stock TF? If it doesn't, you'll probably need a chip / calibration which includes the proper sensor characteristic curve for the MAF you just installed. If you still have the stock MAF, you could try putting that one back in and see if the idle problem goes away - assuming that it ran fine with the stock unit.