flag-based solution to #399 (17 new failures)
a more decent solution to #399 (5 new failures)