When I tried to unlink more than one linked template from parent template with 'Unlink and clear' button, items from these templates were still attached to given template. I've checked the code and seems that 'zbx_array_merge' is the problem.
Here is the code:
I've chenged it to:
and modified 'include/func.inc.php':