Improving linkedselectbox metadata saving

Also, detecting elements with multiple selections better when searching
them