Fixed undefined name errors caused by a34aa4c