Fixed undef errs