* Event handling improvements. Needs more testing