Fix bug where given path is '.'.