Fixed undefined property errors.