Add test for complicated cases