Refix bug with array copy rather than repeated initialization
Demo with copy bugfix