Fix relying on dirty state in tests