Fix for batch update

So that SQL errors are not raised (errors were introduced by #391)