Merging now also detaches values. Just leveling is left.
Fixed a memory allocation problem.