Some errors have reappeared after repeated testing, I will update the post when I have found a final solution.