Fixup readdir bugs.

close #2