Use correct type of user_data in callbacks.