COMMONS-219 fix some bugs