Fixed an an issue getting a single document from the db.