Changes to the database code