Fixed memory leak in Entity

+ Added expected output in main.