Improve the way mouse-enter and mouse-leave events are posted.
Fix some null pointer dereferences.