Issue 6557: Some code improvements #4 after 1b8ca57