Seeing as you aren't just installing a direct replacement ecu, i'd put it all back together with the std ECU and AFM, and give it to a professional.
But if you're hard headed like me, and wont give up that easily;
re-check all your wiring, and make sure all the connections have been properly made.
This caught me out when i replaced my ecu- there was loosely spliced wiring from gadgets installed by a previous owner - and i accidentally disconnected one of the wires without noticing, which caused similar engine behaviour to what you are having.
Check your afm + its wiring, make sure that has been connected properly also.
Make sure the ecu loom is plugged in firmly too - do the bolt up as much as you can. If you dont do it up tightly, the loom can move slighty, and the engine will splutter and shut itself off.