Fix AIRAVATA-1465 and NPE.