Fix Trac #1718: interaction of error, unlifted tuples, and casts