Fix issue with metadata being == None at times