The Cast case of the rule-matcher was simply wrong.
This patch fixes it; see Trac #1746.
I also fixed the rule generation in SpecConstr to generate a wild-card
for the cast expression, which we don't want to match on. This makes
the rule more widely applicable; it wasn't the cause of the bug.