Issue 5190 pt1

Fix an annoying issue where notEmpty() callbacks would cause fatal errors as the entity would be the incorrect type.

Refs #5190