Fixed AddEntity type issues