Fix buf for close filestream.