Merge "Added check for null metadata."