Fix file serialization backend to support complex classes.