Preparation of derivatives of starch