Fixed a regression. Now covered by tests.