Fix issue 6017