Fixing issue where magic method on entities ad documents caused a fatal error.