Fixed an unbound variable and made it handle 1.81.