Bug fix & rewinddir function finished