Fix issue with undefined metadata