Fixed events definition and callback processing.