Updated code to match the new database schema. [deploy-dev]