VID-1824 Fixed various code review bugs