Update local file size after each successful write operation. Fixed rename operation code.