oh you have 4 Enphase Gateways! lol never seen such a big system.. I only built the driver for 1 Enphase gateway.. I'll have to look at adding in an option to select which envoy from a list of discovered ones, this will likely fix the issue as it is probably confusing the driver with the multiple devices being discovered.
I'm currently on vacation so won't be able to look at it for a few weeks.
As for the Error on line 492, that looks to be a quick fix, I will issue a new version shortly to fix that.
*UPDATE*
I just uploaded Version 17, please see if it helps with the Error Line 492. It will not help with your multiple Envoy gateways, I will work on that in the next few weeks.