Fix typo(?) in set_metadata()

This was causing errors every time it was called. I'm fairly confident that the change I put in place is the intended code, please advise.