Ensure serialization compatibility where possible

Not possible for `org.junit.runner.Result`. Potential fix for #976 (needs manual test to confirm).