Fix exit condition in DirReader func