Various bug fixes.

getDateFromUrl() was written earlier to get around this undefined date issue.