Fix Mongoose subdocument errors and formatted syntax to make jshint happy.