Fix batch upload

@Smuldr Could you QA and merge?