Fix bug in dir()