Correcting some functions