fixed chdir to work also in '.'