Ticket #3322: Add test cases. The bug got fixed long time ago