Fixing issues ESBJAVA-3298 and APIMANAGER-2830