Add some more error handling to copy scripts