Changed the set_metadata function to safely check for the date key.
Merge pull request #1110 from garnertb/master

Changed the set_metadata function to safely check for the date key.