Don't rename a directory to a directory

Test by @EdShaw!

Closes #227