Cleaned up error handling in our python scripts.