fixes for MID-1798 and MID-1776