Add OS/file exists guards to scripts