Fixed cache mem leak; update cache in rename