Fixed tests to be more deterministic and avoid leaving directories that can't be deleted in Explorer