fixes #22, changed behaviour of rename
Merge pull request #29 from thornag/fix/dir-rename

Fixed behaviour of rename function closes #22