Merge "Fixed to prevent usagestats file corruption when writing"