scandir bugs fixed