Added function_exists and event_exists.