Fix statement preparation in batch