Improvements to PROV serialization, and input checking