Thank you, @Tom! I was not aware of the USER option, and this is probably a better solution than what I implemented.
re: your second point about the WORK directory being replaced, it doesn't look like the files disappear when this happens, so I don't think that's the culprit.
... View more