fix two recently introduced bugs in rename