Fixed reverse check on HasWhitelistedExtension (if it had a whitelisted extension, it would fail).
Restructured code for Rename.