Fixed two small mistakes in the db triggers.