Add missing headers needed by write().