Improved rename handling