Fix renaming function bug