VID-1281 Updated with fixes suggested in PR