Fixed a critical typo, removed an useless function.