Fixed some functions.