Fix bug with metadata