Fix infinite loop in batch file.