made some good fixes for the protection database.