Fixed renaming bugs