Fixed write callback signature in samples