Entity primary field issues fixed