Fixed a bug where the last query in a file would be read when only reading new tests, even if it wasn't a new test