Improve error handling; make scripts re-executable