#338 Unit test for this bugfix.