Fix for #5737 and some minor doc changes.