Move os.close() command before editor opens the file, so there is only 1 process with the file handle.
Delete special character left by vim.