Handle edge cases occuring in tests