Added some tests for #6499