modify stats script to check for various problems, and fix those problems in all current scripts