BUG: don't crash with an UnboundLocalError for invalid pinfo.