Fixed rename so that if the "to" directory is not empty, rename will not proceed