Fixed undefined functions