Bugfix: Rewritten merge array function