Fixed some functions and added temporary definitions