Changed event handler registration code.