Add test case for issue #653(#791)