For ENG-6530, fix two problems cause ee crashed.