re-add midstate field
not sure its right, but it replicates upstream behavior