VID-488 Several changes recommended by code review