Add more tests for nested merge

Also fix a bug in `remove_collected_key` where default was being removed
from subgroups.