Added a test related to the recent fix in the handling of
the when-clauses.