Fix issue 5820