Bind events correctly.