Get the tests running again and fix the bug caught