Events: added type check for function call.