Fix for bug found in tests