Some additions to correct catch mouse events.