Why do I get the error "Wrong number of arguments" in my event handlers?