99 forrester with ej22swap not running right

Ive got a 99 Forrester that i got pre swapped with a ej2.2 weird swap cause originally dohc to sohc had to ecu swap surely? But to the point, the problem is when trying to accelerate usually is acts fine if u hardly give it any gas but the seccond it hits 2k-3k or give it alot of gas it just bucks and sputters. Now its also weird cause if i pin it thru the bucking and sputtering itl rip like its running great. Im thinking of replacing the maf and maf connector but cant seem to find any maf connectors that are the same and wanted to double check maf compatibility between all the 2.2s my maf connector only has 3 wires coming from it and i read somewhere that it should be 4? If anyone can help it would be very much appreciated. Also if u know part numbers for the maf connector let me know!