Test case for issue6311