Fix metadata issues

Fixes #3363 #3358