More replay fixes. Actually set the data offset.
Avoid stack allocation of potentially large data when checking for null.
Added some comments.