Fixed undefined problems