Fixed event handling in Entity.
Added some niceties in Entity.