Fix test failures after previous bug fixes