Fix Py3 complaining about UnboundLocalError.