Rationalise event handlers and add blur event handler.