Attempt (yes, attempt) to fix unit tests
(cherry picked from commit 9b354e4)