Fix bugs in tests introduced in commit d6f44a72f14a844111280d2b58ad966577f6edae.