Fix issue #286 - Renaming a file end up with two copies

Closes #286.
This line will be removed when @gideonthomas landing his patch @humphd