CP-6697-2

Fix two bugs introduced by CP-6697.