Fixed fatal bug with entitiessometimes being undefined