Fixed possible memory leaks on loot templates load