Fix for bug that shows up in the tests