Fix. Returns nil from write callback treat as write error.