Fixed bug where LastFile was not unset after each loop