Hello, my '96 Legacy has started running rough, dies at idle, loses power.  It smooths out a little at higher RPMs, above 2000 or so. 
  
The error codes I am reading are: P0100, P0303, P0304, P0106, P0170, P0106 again.  I'm thinking that these all point to a MAF sensor problem.  Smoothing out at higher RPM suggests that I'm getting decent fuel pressure, and the MAF and fuel trim codes (100 and 170) together might explain the cylinder 3 and 4 miss codes (303 and 304).  Am I going wrong here?  Is it reasonable to replace the MAF as a starting point, or what would you recommend? 
  
I have a code reader but no scan tool.