BUG: Fix undefined frame_no in batch()

Fixes failing CI