Added test for #distinct chaining