Added serializing of callbacks.