There have been not been glitches since yesterday. At this point I doubt it is by chance. I don't know which command from the first script helped. I should try one by one to find out but that's fine with me as long as it works.
You saved me from a lot of headaches!
Thank you very much for your help!