The name has almost nothing to do with finding the right cannon. Upon installing the cannon the unique vehicle-ID gets assigned as UserData to the cannon, so it should find the correct cannon. I'll take a look into the demo mod soon.
The the bug with the switching prototypes is caused because when you install the supply the person gets hidden and its prototype is copied and respawns. When you remove the supply line that hidden person shows again.
Just for giggles i went and check the Demo Mod and...
Bug 1 also occurs in it!
If engine A flows its deck gun and engine B flows its deck gun 45 seconds later,
Then engine A's tank goes empty engine B's deck gun also gets disabled
If engine A then has a supply line hocked up both deck guns flow again until
engine B's tank goes empty then both deck guns are once again disabled regardless of the water supply being hocked to engine A
If you then put a water supply to engine B both deck guns resume working.
( On a side not this thankfully dose not effect hose connections and handlines)