Protecting file.rename() from folders.