Fix writing empty strings