Improve the various scripts for error checks