Fix client buffer allocation