Modified queries to register runs in the database.