Fixed issue with entities not being indexed correctly