Fix batch mode

In some (most?) cases it didn't execute the entire file.