Fixed some function renaming bugs