Fix IndexError when lookup_symbol() can't find a match