Logic fix
A few other cleanup fixes
Fixed replacement when currently in Entity
A bit cleanup
Fix after review
Fixes after first review
Fixes after second review
Merge pull request #3340 from WebsiteDeveloper/EntityHints

Fix for Issue 3339