Code cleanup. Fixed null pointer error in EntityNode debug mode.

Change-Id: Iad0aad22919aed8ec89ff32543de863e5b4200d3