#1795 Add test to cover the fix