Fix bug in def dometadata