Multiple fixes.

- Was using the built-in function dir as a variable name.
- Was passing the url as parameter when the directory was the one to
  be passed.