HHH-8468 fix

Test case and fix for the HHH-8468