DataEntity refactoring. Out-of-bounds entity check.