Add workaround for some non-trivial case-matches on detaggable data.
Add a regression test.