Handle null metadata values better