Revert "Revert "Fix tests""

This reverts commit 5e48f6a0718e224075c3a0584926e5c8fa003ea4.