When copying a folder beneath itself, don't copy the new copy.

This fixes issue #544.