fix metadata leaves